package animal;

public class Test {

	public static void main(String[] args) {
		Animal a = new Dog();
		a.eat();
		a = new Cat();
		a.eat();
		a = new Eagle();
		a.eat();

		a = new Eagle();
		if(a instanceof Cat) {
			Cat cat = (Cat)a;
			cat.catchMouse();
		}
		else if(a instanceof Dog) {
			Dog dog = (Dog)a;
			dog.pickAFrisbee();
		}
		else if(a instanceof Eagle) {
			Eagle eagle = (Eagle)a;
			eagle.fly();
		}
	}

}
